using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("Newses")]
	[Serializable]
    public class Newse : DBO<Newse>
    {
		#region Fields
		
		private int? _IdNews;
		private string _Title;
		private string _Summary;
		private string _Content;
		private string _Author;
		private DateTime? _CreatedDate;
		private DateTime? _LastModifiedDate;
		private bool? _IsActived;
		private int? _NumberViews;
		private string _Image;
		private bool? _IsVideo;
		private bool? _IsSpecial;
		private bool? _IsHot;
		private int? _NumberComment;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public Newse()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdNews 
		/// </summary>
		/// <param name="IdNews">The IdNews</param>
		public Newse(int? IdNews )
		{
			this.IdNews = IdNews;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdNews">Sets int? value for IdNews</param>
		/// <param name="Title">Sets string value for Title</param>
		/// <param name="Summary">Sets string value for Summary</param>
		/// <param name="Content">Sets string value for Content</param>
		/// <param name="Author">Sets string value for Author</param>
		/// <param name="CreatedDate">Sets DateTime? value for CreatedDate</param>
		/// <param name="LastModifiedDate">Sets DateTime? value for LastModifiedDate</param>
		/// <param name="IsActived">Sets bool? value for IsActived</param>
		/// <param name="NumberViews">Sets int? value for NumberViews</param>
		/// <param name="Image">Sets string value for Image</param>
		/// <param name="IsVideo">Sets bool? value for IsVideo</param>
		/// <param name="IsSpecial">Sets bool? value for IsSpecial</param>
		/// <param name="IsHot">Sets bool? value for IsHot</param>
		/// <param name="NumberComment">Sets int? value for NumberComment</param>
		public Newse(int? idNews, string title, string summary, string content, string author, DateTime? createdDate, DateTime? lastModifiedDate, bool? isActived, int? numberViews, string image, bool? isVideo, bool? isSpecial, bool? isHot, int? numberComment)
		{
			this.IdNews = idNews;
			this.Title = title;
			this.Summary = summary;
			this.Content = content;
			this.Author = author;
			this.CreatedDate = createdDate;
			this.LastModifiedDate = lastModifiedDate;
			this.IsActived = isActived;
			this.NumberViews = numberViews;
			this.Image = image;
			this.IsVideo = isVideo;
			this.IsSpecial = isSpecial;
			this.IsHot = isHot;
			this.NumberComment = numberComment;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdNews
		/// </summary>
		[ColumnAttribute("IdNews", SqlDbType.Int , 4 , true, true, false)]
		public int? IdNews
		{
			set
			{
				this._IdNews = value;
			}
			get
			{
				return this._IdNews;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Title
		/// </summary>
		[ColumnAttribute("Title", SqlDbType.NVarChar , 1000 , false, false, true)]
		public string Title
		{
			set
			{
				this._Title = value;
			}
			get
			{
				return this._Title;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Summary
		/// </summary>
		[ColumnAttribute("Summary", SqlDbType.NVarChar , 1000 , false, false, true)]
		public string Summary
		{
			set
			{
				this._Summary = value;
			}
			get
			{
				return this._Summary;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Content
		/// </summary>
		[ColumnAttribute("Content", SqlDbType.NVarChar , -1 , false, false, true)]
		public string Content
		{
			set
			{
				this._Content = value;
			}
			get
			{
				return this._Content;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Author
		/// </summary>
		[ColumnAttribute("Author", SqlDbType.NVarChar , 1000 , false, false, true)]
		public string Author
		{
			set
			{
				this._Author = value;
			}
			get
			{
				return this._Author;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for CreatedDate
		/// </summary>
		[ColumnAttribute("CreatedDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? CreatedDate
		{
			set
			{
				this._CreatedDate = value;
			}
			get
			{
				return this._CreatedDate;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for LastModifiedDate
		/// </summary>
		[ColumnAttribute("LastModifiedDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? LastModifiedDate
		{
			set
			{
				this._LastModifiedDate = value;
			}
			get
			{
				return this._LastModifiedDate;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsActived
		/// </summary>
		[ColumnAttribute("IsActived", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsActived
		{
			set
			{
				this._IsActived = value;
			}
			get
			{
				return this._IsActived;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for NumberViews
		/// </summary>
		[ColumnAttribute("NumberViews", SqlDbType.Int , 4 , false, false, true)]
		public int? NumberViews
		{
			set
			{
				this._NumberViews = value;
			}
			get
			{
				return this._NumberViews;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Image
		/// </summary>
		[ColumnAttribute("Image", SqlDbType.NVarChar , 100 , false, false, true)]
		public string Image
		{
			set
			{
				this._Image = value;
			}
			get
			{
				return this._Image;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsVideo
		/// </summary>
		[ColumnAttribute("IsVideo", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsVideo
		{
			set
			{
				this._IsVideo = value;
			}
			get
			{
				return this._IsVideo;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsSpecial
		/// </summary>
		[ColumnAttribute("IsSpecial", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsSpecial
		{
			set
			{
				this._IsSpecial = value;
			}
			get
			{
				return this._IsSpecial;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsHot
		/// </summary>
		[ColumnAttribute("IsHot", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsHot
		{
			set
			{
				this._IsHot = value;
			}
			get
			{
				return this._IsHot;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for NumberComment
		/// </summary>
		[ColumnAttribute("NumberComment", SqlDbType.Int , 4 , false, false, true)]
		public int? NumberComment
		{
			set
			{
				this._NumberComment = value;
			}
			get
			{
				return this._NumberComment;
			}
		}
		
		
		/// <summary>
		/// Get a list Comment of current Newse object base on IdNews
		/// </summary>
		public List<Comment> CommentListForIdNews
		{
			get
			{
				if (this.IdNews == null)
					return null;
				Comment condition = new Comment();
				condition.IdNews = this.IdNews;
				return CommentController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list NewsCategory of current Newse object base on IdNews
		/// </summary>
		public List<NewsCategory> NewsCategoryListForIdNews
		{
			get
			{
				if (this.IdNews == null)
					return null;
				NewsCategory condition = new NewsCategory();
				condition.IdNews = this.IdNews;
				return NewsCategoryController.FindItems(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdNews]
            /// </summary>
            public string IdNews
            {
                get
                {
                    return "IdNews";
                }
            }
            /// <summary>
            /// Get the name of column [Title]
            /// </summary>
            public string Title
            {
                get
                {
                    return "Title";
                }
            }
            /// <summary>
            /// Get the name of column [Summary]
            /// </summary>
            public string Summary
            {
                get
                {
                    return "Summary";
                }
            }
            /// <summary>
            /// Get the name of column [Content]
            /// </summary>
            public string Content
            {
                get
                {
                    return "Content";
                }
            }
            /// <summary>
            /// Get the name of column [Author]
            /// </summary>
            public string Author
            {
                get
                {
                    return "Author";
                }
            }
            /// <summary>
            /// Get the name of column [CreatedDate]
            /// </summary>
            public string CreatedDate
            {
                get
                {
                    return "CreatedDate";
                }
            }
            /// <summary>
            /// Get the name of column [LastModifiedDate]
            /// </summary>
            public string LastModifiedDate
            {
                get
                {
                    return "LastModifiedDate";
                }
            }
            /// <summary>
            /// Get the name of column [IsActived]
            /// </summary>
            public string IsActived
            {
                get
                {
                    return "IsActived";
                }
            }
            /// <summary>
            /// Get the name of column [NumberViews]
            /// </summary>
            public string NumberViews
            {
                get
                {
                    return "NumberViews";
                }
            }
            /// <summary>
            /// Get the name of column [Image]
            /// </summary>
            public string Image
            {
                get
                {
                    return "Image";
                }
            }
            /// <summary>
            /// Get the name of column [IsVideo]
            /// </summary>
            public string IsVideo
            {
                get
                {
                    return "IsVideo";
                }
            }
            /// <summary>
            /// Get the name of column [IsSpecial]
            /// </summary>
            public string IsSpecial
            {
                get
                {
                    return "IsSpecial";
                }
            }
            /// <summary>
            /// Get the name of column [IsHot]
            /// </summary>
            public string IsHot
            {
                get
                {
                    return "IsHot";
                }
            }
            /// <summary>
            /// Get the name of column [NumberComment]
            /// </summary>
            public string NumberComment
            {
                get
                {
                    return "NumberComment";
                }
            }
        }
        #endregion
    }
}
